CLOSE
The CLOSE statement closes an open cursor. Once closed, the cursor cannot be used for further processing.
The COMMIT, ROLLBACK, and DISCONNECT statements close all open cursors.
General format
EXEC SQL [ AT Database ]
 
  CLOSE Cursor-Name
 
END-EXEC
Syntax rules
1. Cursor-Name is a Nonnumeric Literal, as defined in the Definitions section in the Preface of this document.
General rules
1. Cursor-Name must be previously defined by a DECLARE statement.
2. Database identifies the active connection that will execute the query and must be previously defined using a Format 4 DECLARE statement. By default, when the AT clause is used, the active connection is switched to the connection identified by Database and all the next statements will work on that connection; under the -csora option, instead, the connection is switched only for the current statement.
Examples
Close cursor
exec sql close cust_cur end-exec